package ee.serge.util;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

public class FormPanel extends Composite {

   private FlexTable table;
   
   public FormPanel() {
      table = new FlexTable();
      table.addStyleName("form-table");
      initWidget(table);
   }
   
   public void add(String name, Widget widget) {
      int row = table.getRowCount();
      table.setWidget(row, 0, new Label(name));
      table.setWidget(row, 1, widget);
   }
   
   public void add(String name, String text) {
      add(name, new Label(text));
   }
   
   public void add(String name, long l) {
      add(name, String.valueOf(l));
   }
   
}
